import requests
from lxml import etree

url = 'https://sc.chinaz.com/jianli/zhengtao.html'
r = requests.get(url)
tree = etree.HTML(r.content.decode('utf-8'))
small_imgs = tree.xpath('//div[@class="box col3 ws_block"]/a[1]/img[1]/@src')
detail_htmls = tree.xpath('//div[@class="box col3 ws_block"]/a[1]/@href')


for detail_html in detail_htmls:
    print(detail_html)
    r_detail = requests.get(detail_html)
    detail_tree = etree.HTML(r_detail.content.decode('utf-8'))

    if detail_tree.xpath('//div[@class="show_warp jl_warp clearfix"]/span/img/@src'):
        detail_imgs = detail_tree.xpath('//div[@class="show_warp jl_warp clearfix"]/span/img/@src')
        for detail_img in detail_imgs:

            detail_img_url = f'https:{detail_img}'
            print(detail_img_url)

    else:
        detail_imgs = detail_tree.xpath('//div[@class="show_warp payshow clearfix"]/span/img/@src')
        for detail_img in detail_imgs:
            detail_img_url = f'https:{detail_img}'
            print(detail_img_url)

    print("____________________________________________________________")

